package com.itany.ems.util;

/**
 * Author:shixiaojun@itany.com
 * Date:2022/3/3 13:53
 * Version:1.0-SNAPSHOT
 */
public class ParameterUtil {

    public static boolean isNull(String s){
        return null == s || "".equals(s);
    }

    /**
     * 检查是否包含对应兴趣
     * @param hobbies   数据库中兴趣的字段
     * @param hobby     当前选项中某个兴趣的value属性值
     * @return
     */
    public static String checkHobby(String hobbies,String hobby){
        if(!ParameterUtil.isNull(hobbies)){
            String[] arr = hobbies.split(",");
            for(String s : arr){
                if(s.equals(hobby)){
                    return "checked";
                }
            }
        }
        return "";
    }

}
